home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Communication / NewsBase / Source / INewsBaseSavePanel.m < prev    next >
Text File  |  1993-01-12  |  1KB  |  52 lines

  1. #import "INewsBaseSavePanel.h"
  2. #import <appkit/Application.h>
  3. #import <appkit/Button.h>
  4. #import <appkit/NXBrowser.h>
  5. #import <appkit/Form.h>
  6. #import <strings.h>
  7. #import "errdebug.h"
  8.  
  9. @implementation INewsBaseSavePanel
  10.  
  11. - ok:sender
  12. {
  13.     [super ok:sender];
  14.     [NXApp stopModal:1];
  15.     return(self);
  16. }
  17.  
  18. - textDidGetKeys:textObject isEmpty:(BOOL)flag
  19. {
  20.     id returnValue;
  21.  
  22.     returnValue = [super textDidGetKeys:textObject isEmpty:flag];
  23.     [okButton setEnabled:YES];
  24.     return(returnValue);
  25. }
  26.  
  27. - (const char *)getPath
  28. {
  29.     static char thePath[1024];
  30.     const char *fileName;
  31.  
  32.     [browser getPath:thePath toColumn:[browser lastColumn]];
  33.     DBG(1, fprintf(stderr, "#%s#", thePath);)
  34.     fileName = [form stringValueAt:0];
  35.     DBG(1, fprintf(stderr, "#%s#", fileName);)
  36.     for (; *fileName == ' '; ++fileName);
  37.     if (*fileName != '\0') {
  38.         strcat(thePath, "/");
  39.         strcat(thePath, [form stringValueAt:0]);
  40.     }
  41.     DBG(1, fprintf(stderr, "#%s#", thePath);)
  42.     return(thePath);
  43. }
  44.  
  45. - findHome:sender
  46. {
  47.     [self setDirectory:getenv("HOME")];
  48.     return(self);
  49. }
  50.  
  51. @end
  52.